1. Field of the Invention
The present invention relates to an image binarizing apparatus suitable for binarizing image data.
2. Description of the Related Art
In general, copying machines and facsimile apparatuses perform binarization on an image with a gray scale to make clear the character image drawn on an input sheet of paper or the like before printing it out or transmission.
Normally, a threshold value is previously determined by a histogram that represents the brightness distribution, and it is determined that individual pixels of the input image are "white" when their values are higher than the threshold value and "black" their values are lower than the threshold value.
Actually, however, there is no fixed standard for the correlation between the histogram and the threshold value and the threshold value may not be set properly. Accordingly, the pixels may not always be binarized properly. The shape of the reference histogram differs greatly depending on the difference in the light source or illumination and on the image to be sensed.
As the first prior art to overcome this problem, Otsu has proposed a scheme to statistically determine the optimum threshold value based on the histogram of brightness of an input image in his report "Method of Automatically Selecting Threshold Value Based on Discrimination and Least Square Rule" (Electronic Information Communication Committee Report D, Vol. J63-D, No. 4, pp. 349-356).
As the second prior art, Babaguchi et al. have proposed, in "Connectionist Model Binarization" (Inter national Journal of Pattern Recognition and Artificial Intelligence, vol. 5, No. 4, pp. 629-644, 1991), that a histogram of brightness for the entire input image be prepared and input to a hierarchical neural network having the same number of input units and output units as the number of orders of the histogram, and that the output unit which responds most strongly be used as the threshold value in binarizing the input image.
Proposed as the third prior art by the present applicant is the image binarizing apparatus described and claimed in Japanese Patent No. 4-131051. In this apparatus, a sensed image is divided into partial image blocks, and parameters are acquired from the histograms of brightness of the partial image blocks and input to a neural network, to thereby determining the threshold value. This method, which cannot be performed by the second prior art, can binarize an image of uneven brightness and requires but a neural network of smaller scale than the neural network required in the second prior art.
In the third prior art, too, when the threshold value for binarization is obtained from the histogram of brightness, the partial image blocks are reduced in size if the input image has uneven brightness. In this case, each partial image block contains a smaller number of pixels, and the histogram of the partial image block no longer reflects the statistical characteristic of the partial image block. Consequently, the threshold value obtained from the histograms of brightness of the partial image blocks has but a poor accuracy, rendering it difficult to binarize the input image with precision. It is not absolutely necessary to prepare a histogram of brightness for each partial image block, for the purpose of extracting the parameter of the brightness distribution in the partial image block.
In any prior art described above, an input image is segmented into partial image blocks, and a threshold value is determined by a neural network directly from the pixel-brightness distributions in the partial image blocks. Due to the fuzziness and nonlinearity of the neural network, however, a very accurate threshold value may not be obtained, which is generally required in order to binarize a low-contrast image.
For instance, in the case where the parameters are input to the neural network to directly acquire the threshold value, the range of the output value of the neural network is that of the gray level of the input image. Since an ordinary CCD sensor handles eight bits, 256 levels are available. Suppose 200 levels are given to the background and 50 levels to the character contrast (the difference between the background and the black character portion). Assuming that there is an error of 5% in the output of the neural network, then sufficient binarization is possible by this neural network because 5% of 256 levels yields about 13 levels.
Actually, sufficient illumination may not always be obtained; if only 50 levels are given to the background, the contrast, which has been 50 levels to the 200-level background, becomes 12.5. In this case, the proper binarization cannot be accomplished by the neural network that has an error of 13 levels. It is apparent that the result of the binarization differs depending on the background level.
To allow the neural network to learn to provide a highly accurate output, learning should be performed on a vast amount of sample data, resulting in inevitable enlargement of the network and increase in the learning time.